<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>淡入淡出</title>
    <style>
        .box{
            width: 150px;
            height: 300px;
            background-color: red;
            display: block;
        }
    </style>
	<!-- 导入jquery库 -->
    <script src="js/jquery2.1.4.min.js"></script>
</head>

<body>
    <button>淡入效果</button>
    <button>淡出效果</button>
    <button>淡入淡出切换</button>
    <button>修改透明度</button>
    <div class="box"></div>
	<script type="text/javascript">
		$(function(){
			console.log('页面加载完成...');
			$('button').eq(0).click(function(){
				$('.box').fadeIn('slow');
			});
			$('button').eq(1).click(function(){
				$('.box').fadeOut('slow');
			});
			$('button').eq(2).click(function(){
				$('.box').fadeToggle('slow');
			});
			$('button').eq(3).click(function(){
				$('.box').fadeTo('slow',0.66);
			});
		});
	</script>
</body>

</html>

</html>